#ifndef SINGLE
//  An adapted ObjectSpace example for use with SGI STL

#include <iostream.h>
#include <algo.h>

#ifdef MAIN
#define unegate2_test main
#endif
struct odd : public unary_function<int, bool>
{
  odd() {}
  bool operator()(int n_) const { return(n_ % 2) == 1; }
};
#endif

#ifdef ACORN_CFRONT
TEMPLATE_not1(odd, int)
#endif

int unegate2_test(int, char**)
{
  cout<<"Results of unegate2_test:"<<endl;

#ifndef ACORN_CFRONT
int array [3] = { 1, 2, 3 };
#else
static int array [3] = { 1, 2, 3 };
#endif

//  odd fn;
//  int* p = find_if(array, array + 3, not1(fn));

  int* p = find_if(array, array + 3, not1(odd()));
  if(p != array + 3)
    cout << *p << endl;
  return 0;
}
